package com.smartcampusbackend.service;

import com.smartcampusbackend.model.RepairApplication;
import com.smartcampusbackend.model.RepairStatusLog;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;

public interface RepairApplicationService {
    
    // 提交维修申请
    boolean submitApplication(RepairApplication application, List<MultipartFile> photos);
    
    // 获取用户的维修申请列表
    List<RepairApplication> getUserApplications(Integer userId);
    
    // 获取维修人员的维修申请列表
    List<RepairApplication> getAssigneeApplications(Integer assigneeId);
    
    // 获取所有维修申请（管理员用）
    List<RepairApplication> getAllApplications();
    
    // 根据状态获取维修申请列表
    List<RepairApplication> getApplicationsByStatus(String status);
    
    // 根据ID获取维修申请详情
    RepairApplication getApplicationById(Long id);
    
    // 分配维修人员
    boolean assignRepairman(Long applicationId, Integer assigneeId, String assigneeName);
    
    // 开始维修
    boolean startRepair(Long applicationId, Integer operatorId, String operatorName);
    
    // 完成维修
    boolean completeRepair(Long applicationId, Integer operatorId, String operatorName, String actualDuration);
    
    // 取消申请
    boolean cancelApplication(Long applicationId, Integer operatorId, String operatorName, String cancelReason);
    
    // 编辑申请
    boolean updateApplication(RepairApplication application, List<MultipartFile> photos);
    
    // 获取维修申请的状态变更记录
    List<RepairStatusLog> getStatusLogs(Long applicationId);
    
    // 获取维修申请统计信息
    Map<String, Object> getStatistics();
    
    // 生成申请编号
    String generateApplicationNo();
    
    /**
     * 导出维修申请数据
     */
    List<RepairApplication> exportApplications(String status, String type, String priority, String keyword);
} 